package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {
	
	//查询没有和定区关联的客户
	@Path("/noAssociations")//访问路径
	@GET                   //请求方式   代表查询
	@Produces({"application/json","application/xml"})//返回数据格式
	List<Customer> findNoAssociationsCustomers();
	
	//查询已经和定区关联的客户
	@Path("/hasAssociations/{fixedAreaId}")
	@GET
	@Consumes({"application/json","application/xml"})//请求数据
	@Produces({"application/json","application/xml"})
	List<Customer> findHasAssociationsCustomer(@PathParam("fixedAreaId")String fixedAreaId);
	
	//将客户与定区关联
	@Path("/associations")
	@PUT
	@Consumes({"application/json","application/xml"})//请求数据
	void associationsCustomer(@QueryParam("customerIds")String customerIds, @QueryParam("fixedAreaId")String fixedAreaId);
	
	
	//保存客户
	@Path("/savecustomer")
	@POST
	@Consumes({"application/json","application/xml"})//请求数据
	void saveCustomer(Customer customer);
	
	//邮箱激活用户
	@Path("/findbytel/{telephone}")
	@GET
	@Consumes({"application/json","application/xml"})//请求数据
	@Produces({"application/json","application/xml"})
	Customer findByTelephone(@PathParam("telephone")String telephone);
	
	@Path("/updatetype/{telephone}")
	@PUT
	@Consumes({"application/json","application/xml"})//请求数据
	void updateType(@PathParam("telephone")String telephone);

	//登陆
	@Path("/customerlogin")
	@GET
	@Consumes({"application/json","application/xml"})//请求数据
	@Produces({"application/json","application/xml"})
	Customer login(@QueryParam("telephone")String telephone,@QueryParam("password")String password);
}
